package Algorithm.DoublePointer;
//https://leetcode-cn.com/problems/consecutive-characters/
public class Leetcode1446 {
    class Solution {
        public int maxPower(String s) {
            int max = 0;
            int from = 0;
            for(int i=0;i<s.length();i++){
                if(s.charAt(i)==s.charAt(from)){
                    max = Math.max(max, i-from+1);
                }else{
                    while(from<i){
                        from++;
                    }
                }
            }
            return max;
        }
    }
}
